select sum(points*credits)/sum(credits) as gpa,id
from grade_points,takes
where grade_points.grade=takes.grade
group by id;
